<?php

include("admin_lock.php");


if(!isset($_POST['loginName']) || !isset $_POST['password'] || !isset $_POST['firstName'] || !isset $_POST['middleName'] || !isset $_POST['lastName'] || !isset $_POST['address'] || !isset $_POST['city'] || !isset $_POST['state'] || !isset $_POST['zipCode'] || !isset $_POST['homeNumber'] || !isset $_POST['workNumber'] || !isset $_POST['cellNumber'] || !isset $_POST['email'])
{
	header("Location: createStudent.php?error=1");
	die();
}

require("config.php");

$loginName=$_POST['loginName'];
$password=$_POST['password'];
$fName=$_POST['firstName'];
$mName=$_POST['middleName'];
$lName=$_POST['lastName'];
$address=$_POST['address'];
$city=$_POST['city'];
$state=$_POST['state'];
$zip=$_POST['zipCode'];
$homeNum=$_POST['homeNumber'];
$workNum=$_POST['workNumber'];
$cellNum=$_POST['cellNumber'];
$email=$_POST['email'];

$createStudentQuery="INSERT INTO Student (login,password,firstName,middleName,lastName,address,city,state,zip,homeNum,workNum,cellNum,email) VALUES ($loginName,$password,$fname,$mName,$lName,$address,$city,$state,$zip,$homeNum,$workNum,$cellNum,$email)";

$studentResult=mysql_query(addslashes($createStudentQuery));

if(!$studentResult)
{
	header("Location: createStudent.php?");
}
else
{
	header("Location: admin.php");
}

?>
